<?php

class Application_Form_Guestbook extends Zend_Form {

	public function init() {
		$this->setMethod('post');
		$this->setAction('index/add');

		// Поле path
		$this->addElement('hidden', 'path', array(
			'required' => false,
			'value' => 0
		));

		// Каптча
		$this->addElement('captcha', 'captcha', array(
			'label' => 'Введите символы с картинки:',
			'required' => true,
			'captcha' => array(
				'captcha' => 'Image',
				'font' => APPLICATION_PATH . '/../public/fonts/arial.ttf',
				'fontSize' => '30',
				'height' => '50',
				'width' => '144',
				'imgDir' => APPLICATION_PATH . '/../public/img/captcha',
				'imgUrl' => '/img/captcha',
				'wordLen' => 5,
				'timeout' => 300
			)
		));

		// Поле text
		$this->addElement('textarea', 'text', array(
			'label' => 'Ваше сообщение',
			'required' => true,
			'filters' => array('StringTrim'),
			'cols' => 60,
			'rows' => 5
		));

		// Кнопка Отправить
		$this->addElement('submit', 'submit', array(
			'ignore' => true,
			'label' => 'Отправить',
		));

		// Защита CSRF
		$this->addElement('hash', 'csrf', array(
			'ignore' => true,
		));
	}

}

